package cn.monkey.chat.server.connect.chat.netty;

import cn.monkey.chat.server.connect.chat.ChatExchange;
import cn.monkey.chat.server.proto.Package;
import cn.monkey.io.transport.core.server.FilterChain;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class NettyChatExchangeConfig {


    @Bean
    NettyChatExchangeFactory nettyChatExchangeFactory(FilterChain<ChatExchange, Package> filterChain) {
        return new SimpleNettyChatExchangeFactory(filterChain);
    }

    @Bean
    NettyChatExchangeManager nettyChatExchangeManager(NettyChatExchangeFactory nettyChatExchangeFactory) {
        return new SimpleNettyChatExchangeManager(nettyChatExchangeFactory);
    }
}
